package com.nave.segundaguerra.activity;

import Enums.Classe;
import Enums.Team;
import android.graphics.Point;
import android.graphics.PointF;

import com.nave.segundaguerra.game.Player;
import com.nave.segundaguerra.servidorecliente.cliente.GeneralCliente;
import com.nave.segundaguerra.servidorecliente.cliente.MedicoCliente;
import com.nave.segundaguerra.servidorecliente.cliente.PlayerCliente;
import com.nave.segundaguerra.servidorecliente.cliente.SoldadoCliente;
import com.nave.segundaguerra.servidorecliente.util.ActivityUtil;
import com.nave.segundaguerra.servidorecliente.util.BitmapStorage;

/**
 * 
 * 
 * @author Thauan Lopes
 * 
 */

public class GameInformation {
//Modify by Nuno Duarte
	//private static Classe classe = Classe.None;
	//private static Team time = Team.NONE;
	private static String classe;
	private static String time;
	private static String namePlayer;
//	private static Player player;
//	private static PlayerCliente playerClient;

	// GETTERS AND SETTERS

//	public static PlayerCliente getPlayerClient() {
//		return playerClient;
//	}
//
//	public static void setPlayerClient(PlayerCliente playerClient) {
//		GameInformation.playerClient = playerClient;
//	}
//
//	public static Player getPlayer() {
//		if (player == null) {
//			player = new Player(ActivityUtil.getCurrentActivity()
//					.getApplicationContext(), new PointF(0, 0), "Thauan");
//		}
//		return player;
//	}
//
//	public static void setPlayer(Player player) {
//		GameInformation.player = player;
//	}

	public static String getClasse() {
		return classe;
	}
	public static void setClasse(String classe) {
		GameInformation.classe = classe;
	}
	
	public static String getTime() {
		return time;
	}
	public static void setTime(Team time) {
		GameInformation.time = time.toString();
	}

	public static String getNamePlayer(){
		return namePlayer;
	}
	public static void setNamePlayer(String name){
		GameInformation.namePlayer = name;
	}
	public static PlayerCliente selecionarPlayerCliente(String classe, String nome,
			PointF position) {

		if (classe.equals("General")) {
			GeneralCliente general = new GeneralCliente(nome, position);
			return general;
		} else if (classe.equals("Soldado")) {
			SoldadoCliente soldado = new SoldadoCliente(nome, position);
			soldado.setImage(BitmapStorage.getInstance().getSoldado(), BitmapStorage.getInstance().getSoldado().getWidth(), BitmapStorage.getInstance().getSoldado().getHeight());
			soldado.setTiro(BitmapStorage.getInstance().getTiro(), BitmapStorage.getInstance().getTiro().getWidth(), BitmapStorage.getInstance().getTiro().getHeight());
			return soldado;
		} else {
			MedicoCliente medico = new MedicoCliente(nome, position);
			medico.setImage(BitmapStorage.getInstance().getMedico(), BitmapStorage.getInstance().getMedico().getWidth(), BitmapStorage.getInstance().getMedico().getHeight());
			return medico;
		}
	}
}
